<template>
  <section class="container">
    <div>
      <app-logo/>
      <h1 class="title">
        nuxt-vue
      </h1>
      <h2 class="subtitle">
        Nuxt.js project
      </h2>
      <div>
        <el-input v-model="formData.account" placeholder="请输入内容"></el-input>
        <el-input v-model="formData.password" type="password" placeholder="请输入内容"></el-input>
        <el-button type="primary" @click="onSubmit()">登录</el-button>
      </div>
      <div class="links">
        <a
          href="https://nuxtjs.org/"
          target="_blank"
          class="button--green">Documentation</a>
        <a
          href="https://github.com/nuxt/nuxt.js"
          target="_blank"
          class="button--grey">GitHub</a>
      </div>
    </div>
  </section>
</template>

<script>
  import AppLogo from '~/components/AppLogo.vue';
  import {Login} from '../plugins/axios.js';

  export default {
    name: 'Index',
    components: {
      AppLogo
    },
    data() {

      return {
        formData: {
          company_id: 2
        }
      };
    },
    methods: {
      onSubmit() {
        Login(this.formData).then(res => {
          console.log(res);
        }).catch(err => {

        });
      }
    }
  };
</script>

<style lang="scss">
  @import "../static/css/base";

  .container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  .title {
    font-family: "Quicksand", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* 1 */
    display: block;
    font-weight: 300;
    font-size: 100px;
    color: #35495e;
    letter-spacing: 1px;
  }

  .subtitle {
    font-weight: 300;
    font-size: 42px;
    color: $textColor;
    word-spacing: 5px;
    padding-bottom: 15px;
  }

  .links {
    padding-top: 15px;
  }
</style>
